﻿@{
	ViewBag.Title = "Index";
	Layout = "~/Views/Shared/_Layout.cshtml";
}
Name:&nbsp;<input type="text" id="name" /><br />
Scale:&nbsp;<select id="scale">
	<option>2</option>
	<option selected="selected">4</option>
	<option>6</option>
	<option>8</option>
</select><br />
<input type="submit" value="Get Skin" id="button" />
<div id="skin"></div>
<script type="text/javascript">
	$(document).ready(function () {
		$('#button').click(getSkin);
		$(document).keypress(function (e) { if (e.charCode = 0 || e.keyCode == 13) { getSkin(); } });
	});


	function getSkin() {

		$.ajax({
			url: '@Url.Action("GetPlayerPhoto", "Home")',
			data: { name: $('#name').val(), scale: $('#scale').val() },
			success: function (data) {
				if (data) {
					$('#skin').html(data);
				}
			}
		});
	}
</script>
